package com.example.demo.controller;

import com.example.demo.model.Student;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.reflect.Array;
import java.util.ArrayList;

@RestController
public class HelloController {

    @GetMapping("hello")
    public String hello()
    {
        return "hello world";
    }

    @GetMapping("stu")
    public Student stu()
    {
        return new Student("3","Alice");
    }
    //@GetMapping("list")
    public ArrayList<Student> list(){
        ArrayList<Student> students = new ArrayList<>();
        students.add(new Student("1","Tom"));
        students.add(new Student("2","Bob"));
        return students;
    }
}
